﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;




namespace Business.Models
{
    public class ISSContext : DbContext
    {
        public DbSet<Administrators> administrators { set; get; }
        public DbSet<DaiLy> DaiLy { set; get; }
        public DbSet<GiaoVien> GiaoVien { get; set; }
        public DbSet<NhanVien> NhanVien { get; set; }
        public DbSet<DiaDiem> DiaDiems { get; set; }
        public DbSet<TruongHoc> TruongHocs { get; set; }
        public DbSet<QuanTri> QuanTri { get; set; }
        public DbSet<NienHoc> NienHoc { get; set; }
        public DbSet<KhoiLop> KhoiLop { get; set; }
        public DbSet<LopHoc> LopHoc { get; set; }
        public DbSet<GiaoVien_LopHoc> GiaoVien_LopHoc { get; set; }
        public DbSet<PhuHuynh> PhuHuynh { get; set; }
        public DbSet<MonHoc> MonHoc { get; set; }
        public DbSet<MonHoc_LopHoc> MonHoc_LopHoc { get; set; }
        public DbSet<HocSinh> HocSinh { get; set; }
        public DbSet<Diem> Diem { get; set; }
        public DbSet<TinNhan> TinNhan { get; set; }

        public ISSContext() : base()
        {
        }

        public ISSContext(string connectionString)
            : base(connectionString)
        {
            Database.SetInitializer<ISSContext>(null);
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new DaiLyConfiguration());
            modelBuilder.Configurations.Add(new DiaDiemConfiguration());
            modelBuilder.Configurations.Add(new TruongHocConfiguration());
            modelBuilder.Configurations.Add(new GiaoVienConfiguration());
            modelBuilder.Configurations.Add(new NhanVienConfiguration());
            modelBuilder.Configurations.Add(new QuanTriConfiguration());
            modelBuilder.Configurations.Add(new NienHocConfiguration());
            modelBuilder.Configurations.Add(new KhoiLopConfiguration());
            modelBuilder.Configurations.Add(new LopHocConfiguration());
            modelBuilder.Configurations.Add(new GiaoVien_LopHocConfiguration());
            modelBuilder.Configurations.Add(new PhuHuynhConfiguration());
            modelBuilder.Configurations.Add(new MonHocConfiguration());
            modelBuilder.Configurations.Add(new MonHoc_LopHocConfiguration());
            modelBuilder.Configurations.Add(new HocSinhConfiguration());
            modelBuilder.Configurations.Add(new DiemConfiguration());
            modelBuilder.Configurations.Add(new TinNhanConfiguration());
            
            base.OnModelCreating(modelBuilder);
        }

        
    }
}